<template>
  <div class="homeEdit">
    <el-form
      :label-position="labelPosition"
      label-width="150px"
      :model="props.obj"
      style="max-width: 460px"
    >
    <el-form-item>
        <el-avatar :size="100" :src="user.img" style="margin-left:30%"/>
      </el-form-item>
      <el-form-item label="用户编号">
        <el-input v-model="user.userId" disabled />
      </el-form-item>
      <el-form-item label="用户账号">
        <el-input v-model="user.username" />
      </el-form-item>
      <el-form-item label="密码(自动加密)">
        <el-input v-model="user.password"/>
      </el-form-item>
      <el-form-item label="邮箱">
        <el-input v-model="user.email" />
      </el-form-item>
      <el-form-item label="状态">
          <el-radio-group v-model="user.status" >
            <el-radio label=1 size="default">冻结</el-radio>
            <el-radio label=0 size="default">正常</el-radio>
          </el-radio-group>
      </el-form-item>
      <el-form-item label="手机号">
        <el-input v-model="user.phone" :placeholder="user.phone"/>
      </el-form-item>
      <el-form-item label="介绍">
        <el-input v-model="user.info" :placeholder="user.info"/>
      </el-form-item>
      <el-form-item label="回收">
        <el-radio-group v-model="user.flag" >
            <el-radio label="1" size="default">回收</el-radio>
            <el-radio label="0" size="default">正常</el-radio>
          </el-radio-group>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { ElMessage, ElMessageBox } from "element-plus";
import { computed, onMounted, reactive, ref } from "vue";
const props = defineProps({
  obj: Object,
});
const user = reactive({});
onMounted(() => {
  Object.assign(user, props.obj);
  user.flag = user.flag === '正常' ? "0" : "1"
  user.status = user.status === '未回收' ? "1" : "0"
  console.log(user);
});
</script>

<style>
</style>